                                                                             /*
  _  _                                                                        *
  _||_                                                                        *
   ||                                                 folkert@feedface.com    *
                                                                             */




#import <UIKit/UIKit.h>

@class NetHackViewController;
@class Segment;


typedef enum {
    EAST,
    NORTHEAST,
    NORTH,
    NORTHWEST,
    WEST,
    SOUTHWEST,
    SOUTH,
    SOUTHEAST,
    CENTER
} Octant;

@interface ActionControl : UIView {

    UILabel *descriptionLabel;
    
    Segment *segment[8];
    CGFloat segmentHotness[8];
    

    BOOL showSegments;
    
    CGFloat ringHotness;

    Octant activeSegment;
    Octant selectedSegment;
    BOOL showSubSegments;

    CGAffineTransform coordinateTransform;

    NetHackViewController *controller;
	
	BOOL usingQuickCommandSelection;
}
- (id) initWithFrame: (CGRect) frame andDictionary: (NSDictionary*) dict;

@property (readonly) CGAffineTransform coordinateTransform;
@property (retain) UILabel* descriptionLabel;
@property (assign) NetHackViewController* controller;


@end


@interface Segment : NSObject {

    ActionControl *control;

    NSString *title;
    NSString *description;

    Octant octant;
    
    Segment* subsegment[8];
    
    char character;
    
    CGPoint titleCoordinates;

}

- (id) initWithDictionary: (NSDictionary*) dictionary;
- (Segment*) subSegmentAtOctant: (Octant) o;


@property (readonly) Octant octant;
@property (readonly) NSString* description;
@property (readonly) NSString* title;
@property (readonly) char character;
@property (readonly) CGPoint titleCoordinates;


@end





